]> dgit.raspbian.org Git - poppler.git/commitdiff
[PATCH] Fix integer overflow in JBIG2Stream::readCodeTableSeg
authorAlbert Astals Cid <aacid@kde.org>
Thu, 6 Aug 2026 22:36:06 +0000 (00:36 +0200)
committerJeremy Bícha <jbicha@ubuntu.com>
Tue, 6 Oct 2026 15:58:35 +0000 (17:58 +0200)
Issue #1760

Gbp-Pq: Name CVE-2026-93313.patch

poppler/JBIG2Stream.cc

index 657c512cfa2247d25375ac9637e95eb687f3e28d..a1c6d28b711f3d65014c091b0e5e149867faa80e 100644 (file)
@@ -4115,7 +4115,12 @@ bool JBIG2Stream::readCodeTableSeg(unsigned int segNum)
             return false;
         }
     }
-    huffTab[i].val = lowVal - 1;
+    int lowValMinusOne;
+    if (unlikely(checkedSubtraction(lowVal, 1, &lowValMinusOne))) {
+        free(huffTab);
+        return false;
+    }
+    huffTab[i].val = lowValMinusOne;
     huffTab[i].prefixLen = huffDecoder->readBits(prefixBits);
     huffTab[i].rangeLen = jbig2HuffmanLOW;
     ++i;